<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/WEB-INF/templates/BasicTemplate.xhtml">

	<ui:define name="content">
		<f:event type="preRenderView"
			listener="#{agentPanelController.beforeAgentPanel}" />
		<h:form prependId="false">
			<h:panelGroup style="text-align: center;" layout="block">
				<p:messages id="messages"></p:messages>
			</h:panelGroup>
			<h:panelGrid columns="2" style="margin:auto;">

				<h:panelGroup id="panel_state" layout="block">
					<h:panelGrid columns="2"
						rendered="#{sessionBean.sessionTypeSelected=='ready' or sessionBean.sessionTypeSelected=='pause' or sessionBean.sessionTypeSelected=='break'}">
						<h:outputLabel value="Estado:"></h:outputLabel>
						<p:selectOneMenu id="sessionTypes"
							value="#{sessionBean.sessionTypeSelected}">
							<f:selectItems value="#{agentPanelController.sessionTypes}" />
							<p:ajax listener="#{agentPanelController.changeState}"
								update="panel_state messages"></p:ajax>
						</p:selectOneMenu>
					</h:panelGrid>
					<h:panelGrid
						rendered="#{sessionBean.sessionTypeSelected=='breakwithcall' or sessionBean.sessionTypeSelected=='pausewithcall' or sessionBean.sessionTypeSelected=='logoutwithcall' or sessionBean.sessionTypeSelected=='pausewithwindow'}">
						<p:outputLabel
							value="Su estado cambiará al finalizar la llamada en curso." />
					</h:panelGrid>
				</h:panelGroup>

				<h:panelGrid columns="2">
					<h:outputLabel value="Llamada actual:"></h:outputLabel>
					<p:inputText id="current_call" value="" readonly="true"></p:inputText>
				</h:panelGrid>


			</h:panelGrid>
		</h:form>
	</ui:define>
</ui:composition>
</html>